<link rel="stylesheet" type="text/css" href="<?=$gs_jspath?>ddsmoothmenu.css" />
<script type="text/javascript" src="<?=$gs_jspath?>ddsmoothmenu.js"></script>
<?
$class_menu	= new menu();
$listAll	= $class_menu->getAllChild("menus", "mnu_id", "mnu_parent_id", 0, "mnu_type = 1 AND mnu_active = 1 AND lang_id = " . $lang_id, "mnu_id,mnu_name,mnu_type,mnu_link,mnu_target", "mnu_order ASC,mnu_name ASC", "mnu_has_child", 0);
unset($class_menu);
$count = count($listAll);
?>

<? if (!preg_match('/(index.php)/', getURL(0,1,1,1))) {?>
<style type="text/css">
/*Top level menu link items style*/
.ddsmoothmenu ul li a{
display: block;
background: #414141; /*background of menu items (default state)*/
color: white;
padding: 8px 57px;
border-right: 1px solid #778;
color: #2d2b2b;
text-decoration: none;
}
</style>
<? }?>

<div id="smoothmenu1" class="ddsmoothmenu">
<ul>
<?
$current_level = 0;
for ($i=0;$i<$count;$i++)
{
?>
	<li><a href="<?=$listAll[$i]['mnu_link']?>" target="<?=$listAll[$i]['mnu_target']?>"><?=$listAll[$i]['mnu_name']?></a>
<?
	if (isset($listAll[$i+1]['level']) && ($current_level == $listAll[$i+1]['level']))
	{
		echo '</li>';
	}
	elseif (isset($listAll[$i+1]['level']) && ($current_level < $listAll[$i+1]['level']))
	{
		echo '<ul>';
		$current_level = $listAll[$i+1]['level'];
	}
	else
	{
		while (isset($listAll[$i+1]['level']) && ($current_level > $listAll[$i+1]['level']))
		{
			echo '</li></ul>';
			--$current_level;
		}
	}
}
?>
</ul>
<br style="clear: left" />
</div>

<script type="text/javascript">

ddsmoothmenu.init({
	mainmenuid: "smoothmenu1", //menu DIV id
	orientation: 'h', //Horizontal or vertical menu: Set to "h" or "v"
	classname: 'ddsmoothmenu', //class added to menu's outer DIV
	//customtheme: ["#1c5a80", "#18374a"],
	contentsource: "markup" //"markup" or ["container_id", "path_to_menu_file"]
})
</script>